﻿<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@ include file="/WEB-INF/layouts/include.inc.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="${ctx }/styles/v2/css/gg.css" />
<script type="text/javascript" language="javascript" src="${ctx }/styles/v2/js/listButton.js"></script>
<!-- border: 2px solid #FFFFFF; -->
<script type="text/javascript">
$(function(){
	
	var time = eval("${time}");
	if(time==1){
		$("#time_1").css("background-color","#d6585b");
	}else if(time==2){
		$("#time_2").css("background-color","#d6585b");
	}else if(time==3){
		$("#time_3").css("background-color","#d6585b");
	}else if(time==4){
		$("#time_4").css("background-color","#d6585b");
	}else if(time==0){
		$("#time_0").css("background-color","#d6585b");
	}
	
	$("#time_1").click(function(){
		$("#time").val(1);
		$("#form1").submit();
	});
	
	$("#time_2").click(function(){
		$("#time").val(2);
		$("#form1").submit();
	});
	
	$("#time_3").click(function(){
		$("#time").val(3);
		$("#form1").submit();
	});
	
	$("#time_4").click(function(){
		$("#time").val(4);
		$("#form1").submit();
	});
	
	$("#time_0").click(function(){
		$("#time").val(0);
		$("#form1").submit();
	});
	
	
});

function getSuperviseList(id){
	$.post("${ctx}/v2/publicSupervise/findByDocId",{"docId":id},function(data){
		
		$("#superviseName").html("监管记录（单位名称："+data.companyName+"）");
		
		$("#superviseList").html("");
	
	
		$(data.superviseList).each(function(i,item){
			var cc="";
			if(item.errored==false)
			cc="未发现问题";
			else
			cc=item.context;
			
		var ss= '<a class="various1" href="${ctx }/v2/publicSupervise/detail?id='+item.id+' " >详细</a>';
			var str = '<tr class="tr_1">'+
				'<td>'+(i+1)+'</td>'+
				'<td>'+item.type+'</td>'+
				'<td>'+item.guideDate+'</td>'+
				'<td style="width: 300px"><c:if test="${item.errored==false}">未发现问题</c:if>'+cc+'</td>'+
				'<td>'+item.userName+'</td>'+
				'<td>'+ss+'</td>'+
			'</tr>';
			
			
			$("#superviseList").append(str);
			$(".various1").fancybox({
			'titlePosition':'inside',
			'transitionIn':'none',
			'transitionOut':'none',
			'centerOnScroll':'true'
		
			});
		});
	});
}
</script>

</head>

<body>
	<div class="op">
		<div class="cz">
			<p style="font-size: 19px;">操作栏</p>
		</div>

		<%@ include file="/WEB-INF/views/v2/publicDoc/left.jsp"%>
		<div  style="padding-top:110px;">
		 <tags:tree url="${ctx }/v2/publicDoc/haveSupervise" formId="form1"></tags:tree> 
	</div></div>


	<div class="con">
		<!--导航begin-->
		<%@ include file="/WEB-INF/layouts/nav.jsp"%>
		<!--导航end-->

		<!--全部管理对象-->
		<div class="object">
			<h3>公共场所列表  (当前位置:${currentAddress.name })</h3>
			<div class="count">
				<p class="c1">
					<b>公共场所档案统计：</b> 
					<input id="time_1" type="button" value="一季度" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaaaaa; color: white; font-size: 13px;" />
					<input id="time_2" type="button" value="二季度" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaaaaa; color: white; font-size: 13px;" /> 
					<input id="time_3" type="button" value="三季度" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaaaaa; color: white; font-size: 13px;" /> 
					<input id="time_4" type="button" value="四季度" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaaaaa; color: white; font-size: 13px;" /> 
					<input id="time_0" type="button" value="全年" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaaaaa; color: white; font-size: 13px;" /> 
					
 
				</p>
				<p style="color: #555; margin: 10px; line-height: 30px;">
					<b><c:choose>
						<c:when test="${time eq 1 }">一季度</c:when>
						<c:when test="${time eq 2 }">二季度</c:when>
						<c:when test="${time eq 3 }">三季度</c:when>
						<c:when test="${time eq 4 }">四季度</c:when>
						<c:when test="${time eq 0 }">全年</c:when>
					</c:choose>档案统计：</b>
				</p>

                <div class="kk" style="margin: 5px;  text-align: center; float: left;">
					<a href="${ctx }/v2/publicDoc/list"><p style="font-size: 20px; color:gary; font-weight: bold;">${pubcount }</p>
					</a><p style="margin-top: 5px; font-size: 14px;">全部档案</p>
				</div>
				<div class="kk" style="margin: 5px; text-align: center; float: left;">
					<p style="font-size: 20px; color: #a4b240; font-weight: bold;">${stat.newNum }</p>
					<p style="margin-top: 5px; font-size: 14px;">新增</p>
				</div>


				<div class="kk" style="margin: 5px; text-align: center; float: left; margin-bottom: 20px;">
					<a href="${ctx }/v2/publicDoc/list?state=营业"><p style="font-size: 20px; color: #488ef6; font-weight: bold;">${stat.startNum }</p>
					</a><p style="margin-top: 5px; font-size: 14px;">营业单位</p>
				</div>
				<div class="kk" style="margin: 5px; text-align: center; float: left; margin-bottom: 20px;">
					<a href="${ctx }/v2/publicDoc/haveSupervise?state=停业"><p style="font-size: 20px; color: #ae48f6; font-weight: bold;">${stat.stopNum }</p>
					</a><p style="margin-top: 5px; font-size: 14px;">停业单位</p>
				</div>
				<div class="kk" style="margin: 5px; text-align: center; float: left;">
					<a href="${ctx }/v2/publicDoc/list?state=注销"><p style="font-size: 20px; color: #f27853; font-weight: bold;">${stat.offNum }</p>
					</a><p style="margin-top: 5px; font-size: 14px;">注销</p>
				</div>
				<div class="kk" style="margin: 5px; text-align: center; float: left; margin-bottom: 20px;">
					<a href="${ctx }/v2/publicSupervise/list"><p style="font-size: 20px; color: #f6ae48; font-weight: bold;">${stat.superviseNum }</p>
					</a><p style="margin-top: 5px; font-size: 14px;">监督次数</p>
				</div>
				
				<div class="kk" style="margin: 5px; text-align: center; float: left; margin-bottom: 20px;">
					<p style="font-size: 20px; color: #f6ae48; font-weight: bold;">${page.totalCount }</p>
					<p style="margin-top: 5px; font-size: 14px;">查询档案数</p>
				</div>
				
				<div class="kk1" style="margin: 5px; text-align: center; float: left; margin-bottom: 20px;">
					<p style="font-size: 20px; color: #f6ae48; font-weight: bold;">${currentSuperviseNum }</p>
					<p style="margin-top: 5px; font-size: 14px;">查询监督次数</p>
				</div>
	<div class="kk1" style="margin: 10px; text-align: center; float: left; margin-bottom: 20px;">
					<p style="font-size: 20px; color: red; font-weight: bold;">${notsupervise }</p>
					<p style="margin-top: 5px; font-size: 14px;">未指导档案</p>
				</div>
			</div>
			<div style="margin-left: 10px; margin-top: 10px;">
				<input id="newBtn" type="button" value="新增" alt="" onclick="location.href='${ctx }/v2/publicDoc/edit'" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> 
				<input id="editBtn" type="button" value="编辑" href="${ctx }/v2/publicDoc/edit" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="superviseBtn" type="button" value="新增监管记录" href="${ctx }/v2/publicSupervise/add" disabled="false" alt="" style="width: 90px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="startBtn" type="button" value="恢复营业" href="${ctx }/v2/publicDoc/start" disabled="false" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="offBtn" type="button" value="注销" href="${ctx }/v2/publicDoc/off" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="stopBtn" type="button" value="停业" href="${ctx }/v2/publicDoc/stop" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="deleteBtn" type="button" value="删除" href="${ctx }/v2/publicDoc/delete" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" />
			</div>

			<form id="form1" name="form1" action="${ctx }/v2/publicDoc/haveSupervise" method="post">
				<input type="hidden" id="time" name="time" value="${time }"/>
				<%-- <div style="margin-left: 10px; margin-top: 10px; color: #6d8ea6">
					单位名称：<input name="companyName" type="text" value="${obj.companyName }" class="btname" /> 
					单位地址：<input name="address" type="text" value="${obj.address }"  class="btname"  />
					负责人：<input name="legal" type="text" value="${obj.legal }"  class="btname"  /> 
					
					<div style="float: right; margin-right: 10px; color: #6d8ea6;">
					类别:
					<select id="sel2" name="runType" style="border: 1px solid #ddd; border-radius: 5px; height: 25px; color: #6d8ea6; width: 60px; margin-right: 10px;">
							<option value="">全部</option>
							<option value="沐浴场所" <c:if test="${obj.runType eq '沐浴场所' }">selected</c:if>>沐浴场所</option>
							<option value="游泳场所" <c:if test="${obj.runType eq '游泳场所' }">selected</c:if>>游泳场所</option>
							<option value="住宿场所" <c:if test="${obj.runType eq '住宿场所' }">selected</c:if>>住宿场所</option>
							<option value="理发美容场所" <c:if test="${obj.runType eq '理发美容场所' }">selected</c:if>>理发美容场所</option>
							<option value="其它公共场所" <c:if test="${obj.runType eq '其它公共场所'}">selected</c:if>>其它公共场所</option>
							
						</select>
						是否有证：
						<select id="sel2" name="hasLicense" style="border: 1px solid #ddd; border-radius: 5px; height: 25px; color: #6d8ea6; width: 60px; margin-right: 10px;">
							<option value="">全部</option>
							<option value="有" <c:if test="${obj.hasLicense eq '有' }">selected</c:if>>有证</option>
							<option value="无" <c:if test="${obj.hasLicense eq '无'}">selected</c:if>>无证</option>
						</select> 状态类型： 
						<select name="state" style="border: 1px solid #ddd; border-radius: 5px; height: 25px; color: #6d8ea6; width: 60px;">
							<option value="">全部</option>
							<option value="营业" <c:if test="${obj.state eq '营业' }">selected</c:if>>营业</option>
							<option value="停业" <c:if test="${obj.state eq '停业' }">selected</c:if>>停业</option>
							<option value="注销" <c:if test="${obj.state eq '注销' }">selected</c:if>>注销</option>
						</select>
						<input type="submit" value="搜索" alt="" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px; margin-left: 5px;" />
					
					</div>

				</div> --%>

				<div>
					<table border="0" cellspacing="0" style="width: 100%;  margin-top: 10px;">
						<tr style="height: 50px; text-align: center;">
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 3%; text-align: center;">&nbsp;&nbsp;&nbsp;</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 18%; text-align: center;">单位名称</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 8%; text-align: center;">负责人/法人代表</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">乡镇</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 18%; text-align: center;">经营地址</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 9%; text-align: center;">联系电话</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">本季度<br />指导数
							</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">本年度<br />指导数
							</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">状态</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 8%; text-align: center;">操作</td>
						</tr>


						<c:forEach items="${page.list }" var="publicDoc" varStatus="status">
							<tr style="height: 50px; text-align: center; background-color: #fff; color: #1c2b36;" onclick="getSuperviseList(${publicDoc.id })" onmouseover="style.backgroundColor='#eee'" onmouseout="style.backgroundColor='#FFFFFF'">
								<td style="border-bottom: 1px solid #ddd;"><input type="checkbox" name="ids" value="${publicDoc.id }" /></td>
								<td style="border-bottom: 1px solid #ddd;">
									<a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black">
										<c:choose>
											<c:when test="${fn:length(publicDoc.companyName) > 7}">
												<c:out value="${fn:substring(publicDoc.companyName, 0,7)}..." />
											</c:when>
											<c:otherwise>
												<c:out value="${publicDoc.companyName}" />
											</c:otherwise>
										</c:choose>
									</a>
								</td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black">${publicDoc.legal}</a></td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black">${publicDoc.street}</a></td>
								<td style="border-bottom: 1px solid #ddd;">
									<a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black">
										<c:choose>
											<c:when test="${fn:length(publicDoc.addressInfo) > 7}">
												<c:out value="${fn:substring(publicDoc.addressInfo, 0, 7)}..." />
											</c:when>
											<c:otherwise>
												<c:out value="${publicDoc.addressInfo}" />
											</c:otherwise>
										</c:choose>
									</a>
								</td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black">
									<c:choose>
											<c:when test="${fn:length(publicDoc.phone) > 11}">
												<c:out value="${fn:substring(publicDoc.phone, 0, 11)}..." />
											</c:when>
											<c:otherwise>
												<c:out value="${publicDoc.phone}" />
											</c:otherwise>
										</c:choose>
								</a></td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black"><tags:docSupervise keyword="publicSupervise" docId="${publicDoc.id }" time="quarter"></tags:docSupervise> </a></td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black"><tags:docSupervise keyword="publicSupervise" docId="${publicDoc.id }" time="year"></tags:docSupervise></a></td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }" style="color:black"><tags:color value="${publicDoc.state }"></tags:color></a></td>
								<td style="border-bottom: 1px solid #ddd;"><a href="${ctx }/v2/publicDoc/detail?id=${publicDoc.id }">详情</a></td>
							</tr>
						</c:forEach>

					</table>


					<!-- <div style="float: right; margin: 5px; margin-right: 10px;">
						<input type="button" value="上一页" alt="" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="1" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="2" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="3" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="4" alt=""
							style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="5" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="下一页" alt="" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" />
					</div> -->
					
					<tags:page></tags:page>
				</div>
			</form>
			<div class="a">
			<p class="gg_1" id="superviseName">监管记录（单位名称：${superviseDoc.companyName }）</p>
	
			<div class="record">
			<table border="0" cellspacing="0" class="table_2 table_4">
			<thead>
					<tr class="tr_1" style="background-color: #005ea8; color: white;">
						<td>序号</td>
						<td>记录类别</td>
						<td>监督指导时间</td>
						<td style="width: 300px">记录指导</td>
						<td>指导人</td>
						<td>操作</td>
					</tr>
			</thead>
					<tbody id="superviseList">
					<c:forEach items="${superviseList }" var="supervise" varStatus="status">
					<tr class="tr_1">
						<td>${status.count }</td>
						<td>${supervise.type }</td>
						<td><fmt:formatDate value="${supervise.guideDate}" type="date"/></td>
						<td style="width: 300px">${supervise.context }</td>
						<td>${supervise.userName }</td>
						<td><a href="${supervise.id }" id="showbtn" name="showbtn" value="点我弹出层" onclick="showid('smallLay');">详细</a></td>
					</tr>
					</c:forEach>
					
					</tbody>
					<!--<tr class="tr_1">
						<td>1</td>
						<td>日常指导</td>
						<td>2014-10-16</td>
						<td>医院环境差</td>
						<td>测试协管员</td>
						<td><a href="#" id="showbtn" name="showbtn" value="点我弹出层" onclick="showid('smallLay');">详细</a></td>
					</tr>
					 <tr class="tr_1">
						<td>1</td>
						<td>日常指导</td>
						<td>2014-10-16</td>
						<td>医院环境差</td>
						<td>测试协管员</td>
						<td><a href="#" id="showbtn" name="showbtn" value="点我弹出层" onclick="showid('smallLay');">详细</a></td>
					</tr> -->
				</table>
			</div>
		</div>
		</div>
		

		<!--全部管理对象-->
	</div>
</body>
</html>
